package 左哥算法.ch14单调栈;

import lombok.SneakyThrows;
import 左哥算法.compare.comparator.MyComparator;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class 彩虹糖 {
    static Reader sc;
    public static void main(String[] args) {
        sc=new Reader();
        int n = sc.nextInt();
        int k = sc.nextInt();
        int m = sc.nextInt();
        while (m-- > 0) {
            if (isOk(n, k)) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }

    public static boolean isOk(int n, int k) {
        boolean ok = true;
        int pre = 1;
        Stack<Integer> stack = new Stack<>(); //存储当前放不了的
        for (int i = 0; i < n; i++) {
            int curr = sc.nextInt();
            if (curr == pre) {
                pre++;
            } else {
                while (!stack.isEmpty() && stack.peek() == pre) {
                    stack.pop();
                    pre++;
                }
                if (stack.empty()) {
                    stack.push(curr);
                    continue;
                }
                if (stack.size() < k && stack.peek() > curr) {
                    stack.push(curr);
                } else {
                    ok = false;
                }
            }
        }
        return ok;
    }

    static class Reader {
        private BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        private StringTokenizer tokenizer = new StringTokenizer("");

        private String innerNextLine() {
            try {
                return reader.readLine();
            } catch (IOException ex) {
                return null;
            }
        }

        public boolean hasNext() {
            while (!tokenizer.hasMoreTokens()) {    //内存中没有
                String nextLine = innerNextLine();
                if (nextLine == null) {     //且没有下一行
                    return false;
                }
                tokenizer = new StringTokenizer(nextLine);  //读入一行
            }
            return true;
        }

        public String nextLine() {
            tokenizer = new StringTokenizer("");    //清空内存中的字符
            return innerNextLine();
        }

        public String next() {
            hasNext();
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

}
